package docmodel;

/**
 * 
 * @author andrea
 *
 */
public class XDPTool {

	/**
	 * 	
	 */
	private static void printUsage() 
	{
		//HTML --> [XDP temp] -->  XDP 
		System.err.println("Usage: java -jar convertXFA source.html destination.xdp [xdp-temp-file.xdp]");
	}
	
	/**
	 * 
	 * @param args
	 */
	public static void main(String[] args) 
	{
		//ARGS
//		if (args.length < 2) 
//		{
//			printUsage();			
//			for(String arg: args) 
//				System.out.print(" - "+arg);		
//			System.exit(2);
//		}		
//		
//		String inputFile 		 = args[0];
//		String outputFile		 = args[1];
//		String xdpOutputFile	 = args[2];			//opzionale
	
		//C:\\prova.html												|
		//C:\\prova-cleaned.html		//XDP_Creator					|
		//C:\\prova.pdf					//XDP_Creator					|
		//C:\\prova-temp.xdp			//XDP_Creator	//XDP_Reader	|
		//C:\\prova.xdp									//XDP_Reader	v
		
		String inputFile 		 = "C:\\prova.html"; 
		//String xdpOutputFile	 = "C:\\prova-temp.xdp";
		String outputFile		 = "C:\\prova.xdp";			

		//XDP Creator
		//XDP_Creator xdp_c = new XDP_Creator(inputFile, "C:\\downloads\\", xdpOutputFile);
		XDP_Creator xdp_c = new XDP_Creator(inputFile, "C:\\downloads\\");				
		//xdp_c.setLiveCycleFolder("C:\\Programmi (x86)\\Adobe\\Adobe LiveCycle Designer ES3\\");	//X ANDREA  
		xdp_c.run();
		
		//XDP Reader
		XDP_Reader_Interface xdp_r = new XDP_Reader(xdp_c.getXdpOutputFile());	
		xdp_r.apriFile();
		xdp_r.run();
		xdp_r.save(outputFile);													 
		
		//P
		System.out.println(xdp_r.getLogBuffer());
		
		//P
		//xdp.liste.stampa_lista();			
		
		//P  
		System.out.println("Completato");			
	}
}
